<template>
  <div>
    <van-nav-bar title="地图找房" left-arrow @click-left="$router.back()" />
    <template>
      <baidu-map
        :center="center"
        :zoom="zoom"
        @ready="handler"
        class="bm-view"
        ak="nYkVt1Uji991GAjXhbmEjvebrPI3v2Ss"
      >
      </baidu-map>
    </template>
  </div>
</template>

<script>
export default {
  async created() {

  },
  data() {
    return {
      center: { lng: 0, lat: 0 },
      zoom: 3
    }
  },
  methods: {
    handler({ BMap, map }) {
      console.log(BMap, map)
      this.center.lng = 116.404
      this.center.lat = 39.915
      this.zoom = 15
    }
  }
}
</script>

<style>
.bm-view {
  width: 100%;
  height: 100vh;
}
</style>
